package wei.xinya.pattern.behavioral.strategy;

/**
 * 开始执行优惠
 */
public class DoCash {
    private final CashType cashType;

    public DoCash(CashType cashType) {
        this.cashType = cashType;
    }

    public double acceptCash(double money) {
        return cashType.getFunction().apply(money);
    }
}
